home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Online / hsc / docs-source / features / getsize.hsc < prev    next >
Encoding:
Text File  |  1997-06-15  |  4.9 KB  |  117 lines

  1. <WEBPAGE chapter="hsc - " title="Get Size Of Images"
  2.          PREV="rplcent.html"
  3.          NEXT="spcattr.html">
  4.  
  5. <P>Several browsers support the attributes <CODE>WIDTH</CODE> and
  6. <CODE>HEIGHT</CODE> for tags like <TG>IMG</TG>. If you know the
  7. exact size of your image, you can tell it the browser. This might
  8. speed up the layout-engine, because the browser doesn't have to
  9. wait for the image to be transfered or needs to re-layout the page
  10. after the transfer.</P>
  11.  
  12. <H2>Usage</H2>
  13.  
  14. <P>As you usually don't know the exact size of your images, let your
  15. stupid computer handle that tricky task by enabling the switch
  16. <op_getsize> when invoking <hsc>. This will <hsc> tell to analyse
  17. the image the attribute <CODE>SRC</CODE> refers to, and append the
  18. attributes <CODE>WIDTH</CODE> and <CODE>HEIGHT</CODE> with the
  19. dimensions obtained from the image data.</P>
  20.  
  21. <P>If you have already set those attributes yourself, <hsc> will
  22. only validate the values, and warn about mismatches.</P>
  23.  
  24. <H2>Example</H2>
  25.  
  26. <P>Take a look at this nice picture of some nice guy:
  27. <IMG SRC=":image/niceguy.gif" ALT="Picture of some nice guy" ALIGN="middle"></P>
  28.  
  29. This can usually be included in a document using
  30.  
  31.     <$source PRE><IMG SRC="image/niceguy.gif" ALT="Picture of some nice guy"></$source>
  32.  
  33. but if a document called <FILE>niceguy.hsc</FILE> is converted using
  34.     <PRE>hsc niceguy.hsc TO niceguy.html GETSIZE</PRE>
  35.  
  36. the <TG>IMG</TG>-tag seen above will be extended to
  37.  
  38.     <$source PRE><IMG SRC="image/niceguy.gif" ALT="Picture of some nice guy" WIDTH="64" HEIGHT="64"></$source>
  39.  
  40. in the html-object. If you do not like the double quotes assigned to the
  41. size values, use the CLI-option <op_quotestyle> to change this behavior.
  42.  
  43. <H2>Supported Image Formats</H2>
  44.  
  45. In the recent years several formats to store image data have been
  46. established - mostly because none of these was really useful. Only a
  47. few of them are supported by <hsc>. However these should be enough for
  48. w3-authoring.
  49.  
  50. <H3>gif - Graphics Interchange Format</H3>
  51.  
  52. <P>In the early times of w3, this was the only format supported by
  53. most browsers. It features only indexed-color (16 or 256 colors) and
  54. an ugly looking progressive display option. It became very popular in
  55. a negative sense because of it's compression algorithm and the
  56. associated copyright.</P>
  57.  
  58. <P>Bye the way, did you know that "The Graphics Interchange Format(c) is
  59. the Copyright property of CompuServe Incorporated. GIF(sm) is a
  60. Service Mark property of CompuServe Incorporated."? So now you do; if
  61. it makes them happy...</P>
  62.  
  63. <H3>jfif/jpeg</H3>
  64.  
  65. <P>Essentially this format does a good job as an idiot indicator. This
  66. already starts with the name: jfif is short for JPEG File Interchange
  67. Format (because it uses jpeg compression for image data). Nevertheless
  68. jfif-pictures will have a file extension set to <qqc>.jpg</qqc> or
  69. <qqc>.jpeg</qqc>.</P>
  70.  
  71. <P>The main feature about jpeg compression is that it is lossy, which
  72. means that the output image is not identical to the input image.
  73. Documents about software using jpeg compression usually claim that you
  74. can obtain good compression levels with no visible change. As long as
  75. you do not start to rotate or apply other complex image processing
  76. operations on pictures, this might even be true. Otherwise an ugly grid
  77. will appear soon.</P>
  78.  
  79. <P>Most important jfif is commonly used to encode images of more or
  80. less undressed people. To store as many such pictures as possible on
  81. as less space as possible, the compression rate is usually set to a
  82. high value. This makes these people look if they are suffered by
  83. leprosy or just a drawing by Egon Schiele.</P>
  84.  
  85. <P>Furthermore many people outside English speaking countries
  86. pronounce jpeg (<qq>jay-peg</qq>) as GPEG (<qq>gee-peg</qq>), even if
  87. they are normally capable of proper English pronunciation.</P>
  88.  
  89.  
  90.  
  91. <H3>PNG - Portable Network Graphics</H3>
  92.  
  93. The <A HREF="http://www.w3.org/pub/WWW/TR/WD-png">PNG Specification</A> (<(HSC.Anchor)>)
  94. claims this format to be
  95.  
  96. <BLOCKQUOTE>...an extensible file format for the lossless, portable,
  97. well-compressed storage of raster images. PNG provides a patent-free
  98. replacement for the GIF format and can also replace many common uses
  99. of TIFF format. Indexed-color, grayscale, and truecolor images are
  100. supported, plus an optional alpha channel. Sample depths range from 1
  101. to 16 bits. PNG is designed to work well in online viewing
  102. applications, such as the World Wide Web, and so it is fully
  103. streamable with a progressive display option.</BLOCKQUOTE>
  104.  
  105. <P>Above all PNG supports most obvious things several other formats
  106. failed to include. There is nothing really remarkable about it, but
  107. today one has the be glad even about this. So it can be said that PNG
  108. is one of the view positive things that happened in the last ten
  109. years.</P>
  110.  
  111. <P>But even despite that their is free source code available to read
  112. PNG-images, and the word <qq>Network</qq> is part of it's name (to
  113. conform to the hype), only few applications and w3-browsers support it
  114. for now.</P>
  115.  
  116. </WEBPAGE>
  117.